from conftest import login_token6
from ApiBase import ApiBase
import pytest,requests


class Test_hotNews():
    def test_hotNews_01(self, login_token6):
        """查询病友圈"""
        userId, sessionId = login_token6
        # 请求地址
        url = 'http://10.59.9.18/health/doctor/sickCircle/v1/searchSickCircle'
        # 请求头
        headers = {
            'userId': str(userId),
            'sessionId': str(sessionId)
        }
        # 请求体
        data = {
            'keyWord': '头疼'
        }
        # 发送post请求
        r = requests.get(url=url, params=data, headers=headers)
        r_json = r.json()
        print(r_json)

    def test_hotNews_02(self, login_token6):
        """发表评论"""
        userId, sessionId = login_token6
        # 请求地址
        url = 'http://10.59.9.18/health/user/sickCircle/verify/v1/publishComment'
        # 请求头
        headers = {
            'userId': str(userId),
            'sessionId': str(sessionId)
        }
        # 请求体
        data = {
            'sickCircleId': 1,
            'content':'少吃油腻食物，多运动多锻炼'
        }
        # 发送post请求
        r = requests.post(url=url, params=data, headers=headers)
        r_json = r.json()
        print(r_json)